#include "lib/web.cpp"

double s2d(const string & s) {
	stringstream ss(s);
	double d;
	ss >> d;
	return d;
}

int main() {
	if (not data.has("step")) {
		data["step"] = "1";
		data["prompt_request"] = "请输入第1个数";
	}
	else if (data["step"] == "1") {
		data["step"] = "2";
		data["number1"] = data["prompt_response"];
		cout << "第1个数是:" << data["number1"];
		data["prompt_request"] = "请输入第2个数";
	}
	else if (data["step"] == "2") {
		data["step"] = "3";
		data["number2"] = data.get("prompt_response");
		cout << "第1个数是:" << data["number1"] << "<br>";
		cout << "第2个数是:" << data["number2"] << "<br>";
		double number1 = s2d(data["number1"]);
		double number2 = s2d(data["number2"]);
		cout << "它们的和是:" << (number1+number2) << "<br>";
	}
}